package edu.pku.dao;

import java.sql.SQLException;
import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;

import edu.pku.data.InReplayPrice;
import edu.pku.util.MySqlMapClient;

public class InReplayPriceDao {
	
	public void addInReplayPrice(InReplayPrice irp) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		sqlMap.insert("insert_in_replayprice",irp);
	}
	
	public void updateInReplayPrice(InReplayPrice irp) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		sqlMap.update("update_in_replayprice",irp);
	}
	
	public List<InReplayPrice> getInReplayPrices(String companyName) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		List<InReplayPrice> list =  sqlMap.queryForList("get_in_replayprices",companyName);
		return list;
	}
	
	public void deleteInReplayPrice(InReplayPrice irp) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		sqlMap.delete("delete_in_replayprice",irp);
	}
	
	
}
